package com.ghca.springdata.repository;

import com.ghca.springdata.entity.Address;
import com.ghca.springdata.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by gh on 2016/10/25.
 */

@Repository
public interface StudentRepository extends JpaRepository<Student, String>{

    Page<Student> findAll(Pageable pageable);

    List<Student> findByAddress_Id(String  addressId);



    Student findByName(@Param("name") String name) ;

}
